package com.fowo.api.controller;

import com.alibaba.fastjson.JSONObject;
import com.fowo.api.common.model.R;
import com.fowo.api.syncLingxingApi.service.syncImpl.SyncProductListServiceImpl;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Tag(name = "领星接口-new")
@RequestMapping("/api/lx-api/sync")
@RestController
public class SyncLingxingApiController {
    @Resource
    SyncProductListServiceImpl syncProductListService;

    @GetMapping("/product-list")
    public R syncProductList(@RequestBody JSONObject object) {
        /*
            int updateTimeStart,
            int updateTimeEnd,
            int createTimeStart,
            int createTimeEnd,
            List<String> skus
         */
        return R.run(() -> syncProductListService.mainLoop(object));
    }
}
